package com.aw.guiguzi.util

import android.app.Activity
import android.view.View
import com.aw.baselib.bean.CommonListBean
import com.aw.baselib.widgets.AwCommonListWithTitlePopupWindow
import com.aw.guiguzi.bean.MsgTemplateItemBean
import com.aw.guiguzi.widgets.MainCalAnalaysisPopupWindow
import com.aw.guiguzi.widgets.MsgCreatePopupWindow
import com.aw.guiguzi.widgets.Num3SingleCheckPopupWindow
import com.aw.guiguzi.widgets.Num7SingleCheckPopupWindow
import com.aw.guiguzi.widgets.NumEnclosePopupWindow
import com.aw.guiguzi.widgets.NumHandleInputPopupWindow
import com.aw.guiguzi.widgets.NumImgPopupWindow
import com.aw.guiguzi.widgets.NumPopupWindow
import com.aw.guiguzi.widgets.NumSingleCheckPopupWindow
import com.aw.guiguzi.widgets.NumSingleCheckRateAnalysisPopupWindow

object AppPopupWindowUtil {
    /**
     * 走势分析开关window
     * @param mActivity
     * @param locationView
     */
    @JvmStatic
    fun showMainCalAnalaysisPopupWindow(mActivity: Activity?, locationView: View?) {
        val popupWindow = MainCalAnalaysisPopupWindow(mActivity!!, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 投注window --- 图片点击方式(主要方式)
     * @param mActivity
     * @param locationView
     * @param callback
     */
    @JvmStatic
    fun showNumImgPopupWindow(
        mActivity: Activity?,
        locationView: View?,
        callback: NumImgPopupWindow.OnResultCallback?
    ) {
        val popupWindow = NumImgPopupWindow(mActivity!!, callback, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 投注window --- 按钮点击方式(作废)
     * @param mActivity
     * @param locationView
     * @param callback
     */
    @JvmStatic
    fun showNumPopupWindow(
        mActivity: Activity?,
        locationView: View?,
        callback: NumPopupWindow.OnResultCallback?
    ) {
        val popupWindow = NumPopupWindow(mActivity!!, callback, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 投注window --- 手输方式(作废)
     * @param mActivity
     * @param locationView
     * @param callback
     */
    @JvmStatic
    fun showNumHandleInputPopupWindow(
        mActivity: Activity?,
        locationView: View?,
        callback: NumHandleInputPopupWindow.OnResultCallback?
    ) {
        val popupWindow = NumHandleInputPopupWindow(mActivity!!, callback, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 投注window --- 单压模拟
     * @param mActivity
     * @param locationView
     * @param callback
     */
    @JvmStatic
    fun showNumSingleCheckPopupWindow(
        mActivity: Activity?,
        locationView: View?,
        callback: NumSingleCheckPopupWindow.OnResultCallback?
    ) {
        val popupWindow = NumSingleCheckPopupWindow(mActivity!!, callback, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 投注window --- 单压模拟, 单押
     * @param mActivity
     * @param locationView
     * @param callback
     */
    @JvmStatic
    fun showNum7SingleCheckPopupWindow(
        mActivity: Activity?,
        locationView: View?,
        callback: Num7SingleCheckPopupWindow.OnResultCallback?
    ) {
        val popupWindow = Num7SingleCheckPopupWindow(mActivity!!, callback, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 投注window --- 单压模拟, 单押
     * @param mActivity
     * @param locationView
     * @param callback
     */
    @JvmStatic
    fun showNum3SingleCheckPopupWindow(
        mActivity: Activity?,
        locationView: View?,
        callback: Num3SingleCheckPopupWindow.OnResultCallback?
    ) {
        val popupWindow = Num3SingleCheckPopupWindow(mActivity!!, callback, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 围数模拟计算window
     * @param mActivity
     * @param locationView
     * @param allNums
     */
    @JvmStatic
    fun showNumEnclosePopupWindow(mActivity: Activity?, locationView: View?, allNums: String?) {
        val popupWindow = NumEnclosePopupWindow(mActivity!!, allNums!!, null)
        popupWindow.showAsLocationBottom(locationView)
    }

    /**
     * 单押模拟计算window
     * @param mActivity
     * @param locationView
     */
    @JvmStatic
    fun showNumSingleCheckRateAnalysisPopupWindow(mActivity: Activity?, locationView: View?) {
        val popupWindow = NumSingleCheckRateAnalysisPopupWindow(
            mActivity!!
        )
        popupWindow.showAsLocationBottom(locationView)
    }

    @JvmStatic
    fun showMsgCreatePopupWindow(
        mActivity: Activity,
        title: String?,
        list: MutableList<MsgTemplateItemBean>?,
        locationView: View?,
        onItemClickListener: MsgCreatePopupWindow.OnItemClickListener?
    ) {
        val commonListPopupWindow = MsgCreatePopupWindow(mActivity, title, null)
        commonListPopupWindow.setListData(list)
        commonListPopupWindow.setOnItemClickListener(onItemClickListener)
        commonListPopupWindow.showAsLocationBottom(locationView)
    }
}